package ai.yale.web;

import ai.yale.service.UserService;
import ai.yale.util.RespMessage;
import ai.yale.vo.LoginVo;
import ai.yale.vo.RegisterVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * Created by asus on 2017/8/17.
 */
@RestController
@CrossOrigin
@RequestMapping("/user")
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping("/login")
    public RespMessage login(LoginVo vo) {
        return userService.login(vo);
    }

    @RequestMapping("/reg")
    public RespMessage reg(RegisterVo vo) {
        return userService.reg(vo);
    }

    @RequestMapping("/list")
    public RespMessage list() {
        return userService.list();
    }
}
